package com.example.fresheveryday.mapper;

import com.example.fresheveryday.po.Suborder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ll
 * @since 2023-07-05
 */
@Mapper
public interface SuborderMapper extends BaseMapper<Suborder> {
    @Select("select * from suborder where orderId = #{ordersId}")
    @Results({
            @Result(column = "productId",property = "productid"),
            @Result(column = "productId",property = "product",one = @One(select = "com.example.fresheveryday.mapper.ProductMapper.selectByIdDiy")
            ),
    })
    public List<Suborder> getListByOrdersId(String ordersId);

}
